import { EnemyManager } from "../Base/EnemyManager"
import SingLeton from "../Base/SingLeton"
import { ILevel, ITile } from "../Levels"
import { BurstManager } from "../Script/Burst/BurstManager"
import { DoorManager } from "../Script/Door/DoorManager"
import { PlayerManager } from "../Script/Player/PlayerManager"
import { SpikesManager } from "../Script/Spikes/SpikesManager"
import { TileManager } from "../Script/Tile/TileManager"
import { WoodenSkeletonManage } from "../Script/WoodenSkeleton/WoodenSkeletonManage"





export type IRecord =Omit<ILevel,'mapInfo'>




export default class DataManager extends SingLeton{


    static get Instance(){
        return super.GetInstance<DataManager>(

        )
    }
    //放地图信息
    mapInfo:Array<Array<ITile>>=[]
    //地图横着和竖着的瓦片数量
    mapRowCount:number=0
    mapColumnCount:number=0
    levelIndex:number =1
    //每一项是个TileManager
    tileInfo:Array<Array<TileManager>>=[]
    player:PlayerManager
    // enemies:WoodenSkeletonManage[]
    
    enemies:EnemyManager[] //李四转换原则
    door:DoorManager

    bursts:BurstManager[]

    spikes:SpikesManager[]

    records:IRecord[]


    reset(){
        this.records=[]
        this.mapInfo=[]
        this.mapColumnCount=0
        this.mapRowCount=0
        this.tileInfo=[]
        this.player=null
        this.enemies=[]
        this.door=null
        
        this.bursts=[]
        
        this.spikes=[]
    }
}


// export const DataManagerInstance = new DataManager()  //暴露一个实例
